<template>
  <div>
    <el-button type="primary" @click="handleAdd">新增项目</el-button>
    <el-table :data="projectList" stripe>
      <el-table-column prop="projectName" label="项目名称"></el-table-column>
      <el-table-column prop="startDate" label="立项日期"></el-table-column>
      <el-table-column prop="projectNumber" label="项目编号"></el-table-column>
      <el-table-column prop="budgetDocumentNumber" label="预算文号"></el-table-column>
      <el-table-column prop="projectManager" label="项目经理"></el-table-column>
      <el-table-column prop="remarks" label="备注"></el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button @click="handleEdit(scope.row)">编辑</el-button>
          <el-button @click="handleDelete(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      projectList: []
    }
  },
  methods: {
    handleAdd() {
      // 实现新增项目功能
    },
    handleEdit(row) {
      // 实现编辑项目功能
    },
    handleDelete(row) {
      // 实现删除项目功能
    },
    fetchData() {
      // 获取项目列表数据
      this.$http.get('/project/list').then(response => {
        this.projectList = response.data.records;
      });
    }
  },
  created() {
    this.fetchData();
  }
}
</script>

<style scoped>

</style>